package Chuong07;

import java.io.*;

public class Bai09 {

	private static FileReader fR;
	private static BufferedReader bR;
	String filename = "D:/Hoc Tap/Hoc Ki VII/Chuyen De Java/OnTap_Code/OnTap/src/Chuong07/File/danhsach1.dat";
	//String filename = "Z:/danhsach.dat";
	
	public Bai09(){
		try {
			fR = new FileReader(filename);
			bR = new BufferedReader(fR);
			String i = bR.readLine();
			int n = 0;
			while (i != null) {
				n++;
				i = bR.readLine();
				
			};
			System.out.println("Số dòng là: " + n);
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		try { 
			fR.close(); 
			bR.close();
		} 
		catch (IOException e) { 
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Bai09();
	}

}
